package com.pucheng.bracelet.app.database.repository

import androidx.annotation.WorkerThread
import com.pucheng.bracelet.app.database.dao.HertRateDao
import com.pucheng.bracelet.data.bean.HertRateBean
import kotlinx.coroutines.flow.Flow

/**
 * 血氧饱和度
 */
class HertRateRepository(private val hrDao: HertRateDao) {

    //查询所有数据
    val allDataTo7Day: Flow<List<HertRateBean>> = hrDao.get7Days()

    //查询所有数据
    val allData: Flow<List<HertRateBean>> = hrDao.getAll()

    // 插入数据
    @Suppress("RedundantSuspendModifier")
    @WorkerThread
    suspend fun insert(bpBean: HertRateBean) {
        hrDao.insert(bpBean)
    }


}